#include "report.h"
#include "ui_report.h"


extern double xLength;
extern double xV;
extern double xD;

Report::Report(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Report)
{
    ui->setupUi(this);
    ui->xL_progressBar->setRange(0,xLength + 200);
    ui->xL_progressBar->setValue(xLength);
    ui->xL_label->setText(QString::number(xLength));

    ui->xV_progressBar->setRange(0,xV + 20);
    ui->xV_progressBar->setValue(xV);
    ui->xV_label->setText(QString::number(xV));

    ui->xDL_progressBar->setRange(0,qAbs(xD) + 10);
    ui->xDR_progressBar->setRange(0,qAbs(xD) + 10);
    if(xD > 0){
        if(xD < 1) ui->xDL_progressBar->setValue(1);
        else ui->xDL_progressBar->setValue(xD);
        ui->xDL_label->setText(QString::number(xD));
    }
    if(xD < 0){
        if(xD > -1) ui->xDR_progressBar->setValue(1);
        else ui->xDR_progressBar->setValue(qAbs(xD));
        ui->xDR_label->setText(QString::number(xD));
    }

}

Report::~Report()
{
    delete ui;
}
